<%@ taglib uri="/WEB-INF/myfaces_html.tld" 	prefix="h" %>
<%@ taglib uri="/WEB-INF/myfaces_core.tld" 	prefix="f" %>
<%@ taglib uri="/WEB-INF/tomahawk.tld"     	prefix="t" %>
<%@ page import="java.util.ArrayList" %>
<%@ taglib uri="/WEB-INF/myfaces_sandbox.tld"   prefix="s" %>


<f:view>
    <jsp:include page="/intestazione.jsp">
        <jsp:param name="titolo" value="Gestione Login"/>
    </jsp:include>
    <jsp:include page="/menu.jsp"/>
    <script language="javascript" src="./script/popup_full_center.js"></script>
    <script language="javascript" src="./script/ripristinoSessione.js"></script>
    <t:saveState value="#{beanLogin}"/>

    <br />  
    <table class="find" style="border: 2pt solid white; margin-bottom: -10px">
        <hr />
        <tr>  
            <td class="intestazionePagina" align="center">
                <strong><t:outputLabel for="ricerca" value="AREA RISERVATA / PROFILO / ANNO GESTIONE" /></strong></td>                        
        </tr>

    </table>

    <h:form binding="#{dettaglioLogin.form}" id="formLookup">    
        <t:saveState value="#{beanLogin}"/>

        <t:panelTabbedPane serverSideTabSwitch="false">

            <t:panelTab id="tabLog1" label="Parametri Accesso">  

                <f:verbatim>  <br />  
                    <br />  <table class="dettaglio" >
                        <tbody> 
                            <tr>     
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="codice" value="Codice"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="codice" value="#{beanLogin.codice}" size="10" maxlength="10" styleClass="dettaglio_InputText" disabled="true"/><f:verbatim></td>
                            </tr>   

                            <tr>                   
                                    <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="nomeUtente" value="Nome utente (*)"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="nomeUtente" value="#{beanLogin.nomeUtente}" size="20" maxlength="20" styleClass="dettaglio_InputText" required="true"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="nomeUtente" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="passwd" value="Password (*)"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="passwd" value="#{beanLogin.passwd}" size="20" maxlength="10" styleClass="dettaglio_InputText" required="true"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="passwd" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>                   
                                <td colspan="4">
                                    <hr width="90%"></td>
                            </tr> 

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="cognome" value="Cognome"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="cognome" value="#{beanLogin.cognome}" size="30" maxlength="30" styleClass="dettaglio_InputText" onchange="this.value=this.value.toUpperCase()" required="true"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="cognome" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>     
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="nome" value="Nome"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="nome" value="#{beanLogin.nome}" size="30" maxlength="30" styleClass="dettaglio_InputText" onchange="this.value=this.value.toUpperCase()" required="true"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="nome" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr> 
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="dataNascita" value="Data Nascita"/><f:verbatim></strong></td>
                                <td></f:verbatim><h:outputText value=" (gg/mm/aaaa)" style="font-size:6.5pt"/>
                                <f:verbatim><br/></f:verbatim>
                                <t:inputCalendar id="dataNascita" renderAsPopup="true" renderPopupButtonAsImage="true" popupDateFormat="dd/MM/yyyy" size="10" styleClass="campoTesto" value="#{beanLogin.dataNascita}">
                                    <f:convertDateTime pattern="dd/MM/yyyy" type="both" timeZone="Europe/Rome"/>
                                </t:inputCalendar>
                                <h:message style="color: red" for="dataNascita" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>        

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="licenza" value="licenza"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="licenza" value="#{beanLogin.licenza}" size="30" maxlength="20" styleClass="dettaglio_InputText" disabled="true"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="licenza" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="descrizioneConfigurazione" value="Azienda" /><f:verbatim></strong></td>
                                <td></f:verbatim>
                                <t:inputText id="descrizioneConfigurazione" value="#{beanLogin.beanConfigurazione.ragioneSociale}" onchange="submit()" valueChangeListener="#{dettaglioLogin.lookUp}" size="45" styleClass="dettaglio_InputText">
                                    <f:attribute name="nomeBean" value="beanConfigurazione" />
                                    <f:attribute name="nomeBeanLookUp" value="Configurazione" />
                                </t:inputText>
                                <t:inputText id="codiceConfigurazione" value="#{beanLogin.beanConfigurazione.codice}" styleClass="dettaglio_InputText" size="5" disabled="true"/>
                                <f:verbatim></td>              
                                <td></f:verbatim>                
                                <t:commandLink id="cercaLookup2" onclick="loadurl('lookup/lookupConfigurazione.jsf?lookup=descrizioneConfigurazione');" immediate="true">
                                    <t:graphicImage url="image/system-search.png" border="0" title="Cerca Elemento"/>
                                </t:commandLink>
                                <f:verbatim></td>                
                            </tr>       

                            <tr>     
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="email" value="Email"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="email" value="#{beanLogin.email}" size="50" maxlength="100" styleClass="dettaglio_InputText" required="false"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="email" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="nota" value="Nota"/><f:verbatim></strong></td>
                                <td><strong style="color:red;">Importante: Per rendere valide eventuali modifiche apportate a questa form bisogna uscire e rientrare dalla procedura.</strong>
                                </td>
                            </tr>   

                        </table></f:verbatim>
                <t:inputHidden value="#{beanLogin.id}"/>   

                <f:verbatim><table bgcolor="#FFFFFF" width="750px">
                        <tr>    
                            <td></f:verbatim>
                            <h:commandLink styleClass="commandLink_Style" dir="RTL" action="benvenuto" immediate="true">
                                <t:graphicImage url="/image/go-home.png" border="0"/>
                            </h:commandLink>              
                            <f:verbatim></td>   
                            <td></f:verbatim>
                            <h:commandLink dir="RTL" onmousedown="return confirmUpdate(this);" title="modifica" action="#{dettaglioLogin.modifica}" rendered="#{beanLogin.id ne null}">
                                <t:graphicImage url="image/salva.png" border="0" title="Salva modifiche"/>
                                <f:param name="bean" value="beanLogin" />
                            </h:commandLink>                
                            <f:verbatim></td>    
                            <td></f:verbatim>
                            <h:commandLink dir="RTL" onmousedown="return confirmSave(this);" title="salva inserimento" action="#{dettaglioLogin.inserisci}" rendered="#{beanLogin.id eq null}">
                                <t:graphicImage url="image/salva.png" border="0" title="Salva inserimento"/>
                                <f:param name="bean" value="beanLogin" />
                            </h:commandLink>                
                            <f:verbatim></td>
                        </tr>
                    </table></f:verbatim>

            </t:panelTab>  

            <t:panelTab id="tabLog2" label="Parametri Applicazione">  

                <f:verbatim><table class="dettaglio" >
                        <tbody> 

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="annoGestione" value="Anno Gestione"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="annoGestione" value="#{beanLogin.annoGestione}" size="4" maxlength="4" styleClass="dettaglio_InputText" required="true"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="annoGestione" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>               

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="sottoScorta" value="Sotto Scorta"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="sottoScorta" value="#{beanLogin.sottoScorta}" size="4" maxlength="4" styleClass="dettaglio_InputText" required="true"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="sottoScorta" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>         

                            <tr>
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="ordineProd" value="Ordinamento Prodotti"/><f:verbatim></strong></td>
                                <td></f:verbatim>
                                <t:selectOneMenu id="ordineProd" value="#{beanLogin.ordineProd}" >
                                    <f:selectItem itemValue="C" itemLabel="Codice"/>
                                    <f:selectItem itemValue="D" itemLabel="Descrizione"/>
                                </t:selectOneMenu>           
                                <f:verbatim></td>
                            </tr>

                            <tr>
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="stampaSconto" value="Stampa Sconto in Fatturazione"/><f:verbatim></strong></td>
                                <td></f:verbatim>
                                <t:selectOneMenu id="stampaSconto" value="#{beanLogin.stampaSconto}" >
                                    <f:selectItem itemValue="S" itemLabel="Si"/>
                                    <f:selectItem itemValue="N" itemLabel="No"/>
                                </t:selectOneMenu>           
                                <f:verbatim></td>
                            </tr>
                            <tr>
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="stampaAnno" value="Stampa Anno in Fattura"/><f:verbatim></strong></td>
                                <td></f:verbatim>
                                <t:selectOneMenu id="stampaAnno" value="#{beanLogin.stampaAnno}" >
                                    <f:selectItem itemValue="S" itemLabel="Si"/>
                                    <f:selectItem itemValue="N" itemLabel="No"/>
                                </t:selectOneMenu>           
                                <f:verbatim></td>
                            </tr>

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="ricarico" value="Ricarico"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="ricarico" value="#{beanLogin.ricarico}" size="30" maxlength="15" styleClass="dettaglio_InputText" required="true">
                                    <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.00" />
                                </t:inputText>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="ricarico" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="listino1" value="Listino 1"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="listino1" value="#{beanLogin.listino1}" size="30" maxlength="15" styleClass="dettaglio_InputText" required="true"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="listino1" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="ricarico1" value="Ricarico 1"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="ricarico1" value="#{beanLogin.ricarico1}" size="30" maxlength="15" styleClass="dettaglio_InputText" required="true">
                                    <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.00" />
                                </t:inputText>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="ricarico1" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="listino2" value="Listino 2"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="listino2" value="#{beanLogin.listino2}" size="30" maxlength="15" styleClass="dettaglio_InputText" required="true"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="listino2" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>      

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="ricarico2" value="Ricarico 2"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="ricarico2" value="#{beanLogin.ricarico2}" size="30" maxlength="15" styleClass="dettaglio_InputText" required="true">
                                    <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.00" />
                                </t:inputText>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="ricarico2" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="listino3" value="Listino 3"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="listino3" value="#{beanLogin.listino3}" size="30" maxlength="15" styleClass="dettaglio_InputText" required="true"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="listino3" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="ricarico3" value="Ricarico 3"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="ricarico3" value="#{beanLogin.ricarico3}" size="30" maxlength="15" styleClass="dettaglio_InputText" required="true">
                                    <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.00" />
                                </t:inputText>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="ricarico3" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="listino4" value="Listino 4"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="listino4" value="#{beanLogin.listino4}" size="30" maxlength="15" styleClass="dettaglio_InputText" required="true"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="listino4" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="ricarico4" value="Ricarico 4"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="ricarico4" value="#{beanLogin.ricarico4}" size="30" maxlength="15" styleClass="dettaglio_InputText" required="true">
                                    <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.00" />
                                </t:inputText>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="ricarico4" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="listino5" value="Listino 5"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="listino5" value="#{beanLogin.listino5}" size="30" maxlength="15" styleClass="dettaglio_InputText" required="true"/>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="listino5" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>      

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="ricarico5" value="Ricarico 5"/><f:verbatim></strong></td>
                                <td></f:verbatim><t:inputText id="ricarico5" value="#{beanLogin.ricarico5}" size="30" maxlength="15" styleClass="dettaglio_InputText" required="true">
                                    <s:convertNumber minIntegerDigits="1" maxFractionDigits="2" pattern="#,##0.00" />
                                </t:inputText>
                                <f:verbatim><br/></f:verbatim>
                                <h:message style="color: red" for="ricarico5" showDetail="true" showSummary="false" />
                                <f:verbatim></td>
                            </tr>   

                            <tr>                   
                                <td class="etichettaDettaglio"><strong></f:verbatim><t:outputLabel for="nota2" value="Nota"/><f:verbatim></strong></td>
                                <td><strong style="color:red;">Importante: Per rendere valide eventuali modifiche apportate a questa form bisogna uscire e rientrare dalla procedura.</strong>
                                </td>
                            </tr>   

                        </table></f:verbatim>


                <f:verbatim><table bgcolor="#FFFFFF" width="750px">
                        <tr>    
                            <td></f:verbatim>
                            <h:commandLink styleClass="commandLink_Style" dir="RTL" action="benvenuto" immediate="true">
                                <t:graphicImage url="/image/go-home.png" border="0"/>
                            </h:commandLink>              
                            <f:verbatim></td>   
                            <td></f:verbatim>
                            <h:commandLink dir="RTL" onmousedown="return confirmUpdate(this);" title="modifica" action="#{dettaglioLogin.modifica}" rendered="#{beanLogin.id ne null}">
                                <t:graphicImage url="image/salva.png" border="0" title="Salva modifiche"/>
                                <f:param name="bean" value="beanLogin" />
                            </h:commandLink>                
                            <f:verbatim></td>    
                            <td></f:verbatim>
                            <h:commandLink dir="RTL" onmousedown="return confirmSave(this);" title="salva inserimento" action="#{dettaglioLogin.inserisci}" rendered="#{beanLogin.id eq null}">
                                <t:graphicImage url="image/salva.png" border="0" title="Salva inserimento"/>
                                <f:param name="bean" value="beanLogin" />
                            </h:commandLink>                
                            <f:verbatim></td>

                        </tr>
                    </table></f:verbatim>
            </t:panelTab>  

        </t:panelTabbedPane>
    </h:form>

    <h:form id="erroriDataBase" rendered="false">
        <f:verbatim><table><td align="left" class="messaggiErrore" height="2px"></f:verbatim>           
                <h:messages style="color: red" showDetail="true" showSummary="false"/>
                <f:verbatim></td></table></f:verbatim>
            </h:form>     

    <jsp:include page="/piePagina.jsp"/>      
</f:view>
